package IT01;

public class Demo {
    public static void main(String[] args) {
        Person p = new Basketballcoach("英俊",20);
        System.out.println("篮球教练：");
        System.out.println(p.getName()+","+p.getAge());
        p.eat();
        ((Basketballcoach) p).teach();
        p = new Basketballplayer("南樱",18);
        System.out.println("篮球运动员：");
        System.out.println(p.getName()+","+p.getAge());
        p.eat();
        ((Basketballplayer) p).learing();
        p = new PingPangcoach("张三",22);
        System.out.println("乒乓球教练：");
        System.out.println(p.getName()+","+p.getAge());
        p.eat();
        ((PingPangcoach) p).teach();
        p.study();
        p = new Pingpangplayer("梨花",18);
        System.out.println("乒乓球运动员：");
        System.out.println(p.getName()+","+p.getAge());
        p.eat();
        ((Pingpangplayer) p).learing();
        p.study();
    }
}
